<?php

/**
 * This file is part of the Pagizer package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @copyright   Copyright (c) 2010 Advisa (http://www.advisa.fr)
 * @author      Pagizer Core Team <team@pagizer.org>
 * @package     pagizer
 * @subpackage  users
 */

class m_users_actions_block_ListGroupsAction extends m_backoffice_extends_Action
{	
	public function execute()
	{		
		$docId = m_backoffice_services_RootNodeService::getInstance()->getModuleRootNode("users")->getUniqueId();

		if($this->getRequestParameter("docId"))
		{
			$docId = $this->getRequestParameter("docId");
		}

		$documentProvider = f_document_Provider::getInstance();
		$groupsData = $documentProvider->loadDocuments("modules_users/group")->isChildOf($docId, "group")->retrieveDocuments();
		$values["groups"] = $groupsData;
				
		$this->setModel($values);
		$this->setView('success');
	}	
}